import { createApp } from './main'

export default async (context) => {
  const { app, store } = createApp()

  if (context.xAToken) {
    window.xAToken = context.xAToken
  }

  if (context.query) {
    await store.dispatch('form/getData', context.query)
  }

  context.state = store.state

  return app
}